package com.yc.chatroom.server.util;

import cn.hutool.core.date.DateUtil;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;

public class JWTUtil {

    public static String getToken(String data, String key) {
        return JWT.create().withAudience(data).withIssuedAt(DateUtil.date()).sign(Algorithm.HMAC256(key));
    }
}
